package com.example.javatwo.service.cg.dwh;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 自动生成单号
 * @author Administrator
 * 
 *
 */
public class ZiDongdanhao {
	
	public static String Danhaoshengcheng(String data){
		String datas = new SimpleDateFormat("yyyyMMdd").format(new Date());
		System.out.println(datas);
		System.out.println(data.substring(0, 8));
		String dates=null;
		if(data == null || !data.substring(0, 8).equals(datas)){
			dates = datas+"001";
		}else if(data.substring(0, 8).equals(datas)){
//			if(data.substring(0, 8).equals(datas)){
				dates = String.valueOf((Long.parseLong(data)+1));
//			}
		}
		
		  return dates;
		
	}
}
